#ifndef __SAVE_H__
#define __SAVE_H__

#include "vbb_Header.h"
#include "vbb_FLASHMEM.h"
#include "vbb_Sensor.h"
#include "vbb_METER.h"
//#include "vbb_GSM.h"

bool vbb_SAVE_TestMemory(void);
void vbb_SAVE_Format(void);
void vbb_SAVE_LoadFlashInfo(VBB_FlashMem * FlashMem);
void vbb_SAVE_SaveFlashInfo(VBB_FlashMem * FlashMem);

#define SAVE_FLASHMEM_HEAD              4   // 2 register x 16 bit
#define SAVE_FLASHMEM_TAIL              6   // 2 register x 16 bit
#define SAVE_FLASHMEM_SEND              8   // 2 register x 16 bit
#define SAVE_GSM_LASTCOMMUNICATION      16  // 2 register x 16 bit
#define SAVE_GSM_FIRMWARE_DOWNLOADING   18  // 2 register x 16 bit
#define SAVE_GSM_FIRMWARE_TO_PROGRAM    20  // 2 register x 16 bit
#define SAVE_GSM_DOWNLOAD_INDEX         22  // 2 register x 16 bit
#define SAVE_GSM_DOWNLOAD_VERSION       24  // 2 register x 16 bit
#define SAVE_GSM_DOWNLOAD_ADDR          26  // 2 register x 16 bit
#define SAVE_COLLECTED_PULSE            28  // 2 register x 16 bit
#define SAVE_METER_LASTSYNC             30  // 2 register x 16 bit
#define SAVE_GSM_LAUNCH_USERAPP         32  // 2 register x 16 bit
#define SAVE_GSM_BOOT_COUNT             34  // 2 register x 16 bit
#define SAVE_METER_FREE_PULSE           36  // 2 register x 16 bit
#define SAVE_METER_BUSY_PULSE           38  // 2 register x 16 bit
#define SAVE_METER_CAB_ON_TIME          40  // 2 register x 16 bit

#endif
